import _Vue, { PluginObject } from "vue";

import UserInfo from './user-info';

declare module "vue/types/vue" {
    interface Vue {
        $user: UserInfo;
    }
}

/** 暴露 UserInfo栈堆 */
export const user: UserInfo = new UserInfo();

/** 暴露 UserInfo栈堆初始化 */
export const UserInfoPlugin: PluginObject<string> = {
    install: function (Vue: typeof _Vue, option: any = {}) {
        Vue.prototype.$user = user;
    }
};

/** 默认 暴露UserInfo栈堆初始化 */
export default UserInfoPlugin;
